<?php

	include("common.php");
	
	$result = mysql_query("SELECT * FROM `197_albums`");
	$albums = array();
	while($row = mysql_fetch_assoc($result)){
		array_push($albums, $row);
	}
	
?>
<?php include("header.php"); ?>
<h1>相簿</h1>
<script type="text/javascript" defer="defer">
	$(function(){
		$("#album-list a[title]").tooltip({

			// a little tweaking of the position
			offset: [10, 10],

			// use the built-in fadeIn/fadeOut effect
			effect: 'slide',
			slideOffset: 5,
			direction: 'top',

			// custom opacity setting
			opacity: 10,
			
			tipClass: "text-tooltip"
		});
	});
	
</script>
<link rel="stylesheet" href="./jquery/css/text-tooltip.css" />
<?php if(empty($albums)){ ?>
	<p>目前沒有相簿。</p>
<?php } else { ?>
	<ul id="album-list" style="font-size: 20px;">
		<?php foreach($albums as $row){ ?>
			<li><a href="imageList.php?album_id=<?php echo $row['album_id']; ?>" title="<?php echo htmlspecialchars($row['description']); ?>"><?php echo $row['title']; ?></a></li>
		<?php } ?>
	</ul>
<?php } ?>
<?php include("sidebar.php"); ?>
<?php include("footer.php"); ?>